bitkeeper revision 1.1159.70.3 (41389f22BlnxYbup7d6jcZXvICR6qg)
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Fri, 3 Sep 2004 16:43:14 +0000 (16:43 +0000)
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Fri, 3 Sep 2004 16:43:14 +0000 (16:43 +0000)
Fix problem with domain shutdown events.

tools/python/xen/xend/XendDomain.py

index 2111a166bd82076347776ead88e5b6b24bcb2716..afe2a4601bfb23ae96314f7d63be54def56c3dd8 100644 (file)
@@ -243,12 +243,12 @@ class XendDomain:
             if d['shutdown']:
                 reason = XendDomainInfo.shutdown_reason(d['shutdown_reason'])
                 log.debug('XendDomain>reap> shutdown id=%s reason=%s', id, reason)
+                dominfo = self.domain_by_id.get(id)
+                name = (dominfo and dominfo.name) or '??'
                 if reason in ['suspend']:
-                    dominfo = self.domain_by_id.get(id)
                     if dominfo.is_terminated():
                         log.debug('XendDomain>reap> Suspended domain died id=%s', id)
                     else:
-                        name = (dominfo and dominfo.name) or '??'
                         eserver.inject('xend.domain.suspended', [name, id])
                         continue
                 if reason in ['poweroff', 'reboot']: